/*
 * @(#)ButtonPanel.java     Robert Denda&Didier Gutacker
 *
 */

/** 
 * Die Klasse ButtonPanel stellt die benoetigten Tasten zu Verfuegung.  Sie ist 
 * damit eine der graphischen Komponenten des SimulationFrame.
 * Sie ist die Basisklasse fuer die Tastenfelder der Simulationen des RIP- und der Multicasting-
 * Algorithmen ButtonPanelRIP und ButtonPanelDVMRP 
 *
 *
 * @author 	Robert Denda&Didier Gutacker
 * @version     1.1, 05.09.1997
 * @see SimulationFrame
 * @see ButtonPanelRIP 
 * @see ButtonPanelDVMRP
 * @see TextMethods
 *
 */

import java.awt.*;
import java.lang.*;

public abstract class ButtonPanel extends Panel {

  // debugging 
  public  debug DEBUG;

  public TextMethods text;
  public Button addLinkButton;
  public Button addNodeButton;
  public Button removeLinkButton;
  public Button removeNodeButton;
  public Button stopButton;
  public Button continueButton;
  public Button startSendingButton;
  public Button stopSendingButton;
 
  public Button inspectRoutingTableButton;
 
  public boolean stopped = false;  

  /**
   * Erneuere alle Buttonbezeichnungen 
   */

  public void redrawLabels( TextMethods text ) {
    this.text = text;		// update text context
    removeAll();
    addLinkButton = new Button( text.buttonPanel_addLinkButtonText );
    addNodeButton = new Button( text.buttonPanel_addNodeButtonText );

    removeLinkButton = new Button( text.buttonPanel_removeLinkButtonText );
    removeNodeButton = new Button( text.buttonPanel_removeNodeButtonText );

    stopButton = new Button( text.buttonPanel_stopButtonText );

    continueButton = new Button( text.buttonPanel_continueButtonText );

    inspectRoutingTableButton = new Button( text.buttonPanel_inspectRoutingTableButtonText );

    startSendingButton = new Button( text.buttonPanel_startSendingButtonText );

    stopSendingButton = new Button( text.buttonPanel_stopSendingButtonText );

    add( addNodeButton );
    add( removeNodeButton );
    add( inspectRoutingTableButton );

    add( addLinkButton );
    add( removeLinkButton );
    add( startSendingButton );

    add( stopSendingButton );
    add( continueButton );
    add( stopButton );

  } // ButtonPanel.redrawLabels

  /**
   * Inaktiviert alle Buttons
   */

  void disableAll() {
    addNodeButton.disable();
    removeNodeButton.disable();
    inspectRoutingTableButton.disable();
    
    addLinkButton.disable();
    removeLinkButton.disable();
    startSendingButton.disable();
    
    stopSendingButton.disable();
    continueButton.disable();
    stopButton.disable();

  } // ButtonPanel.disableAll

} // ButtonPanel







